<template>
<div class="exam-wrap">
        <div class="record-wrap">
            <mt-cell v-for="(item,index) in listdata" to="/exam" :key="index" :title="item.title" :label="item.date" is-link>
                <span class="color-red score">{{item.score}}</span>
                <span>{{item.examination}}</span>
            </mt-cell>
        </div>
    </div>
</template>

<style>
    .score{
        font-size: 12px;
        padding-right: 8px;
        padding-top: 2px;
    }
</style>

<script>
	import conf from '../config/userconf.js'
export default {
    name: "record",
    data() {
        return {
            listdata: [], //历史记录考试列表数据
            page: 1,  //页码
        };
    },
    methods: {
    	init(data=Object()){
    		data.page = this.page;  //页码
    		conf.exams.answerrecordlist(data,(state,res)=>{
		          if (state == 'success'&&res.data.status == 1){
		               console.log(res.data);
		              this.listdata = res.data.other.list;
		              
		          }else if(state == 'success'&&res.data.status != 1){
		              this.$toast(res.data.message);
		          }
	        })
    	},
        tolink(){
            this.router.push('exam');
        },
    },
    mounted() {
    	this.init();
        document.title = "查看历史记录";	
        
    }
};
</script>